package com.lanou.dao.impl;

import com.lanou.bean.BigImg;
import com.lanou.dao.BigImgDao;
import com.lanou.utils.JDBCUtils;

import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;

public class BigImgDaoImpl implements BigImgDao {
    private Connection connection;
    private PreparedStatement pstm;
    private ResultSet rs;
    @Override
    public void insertInfo(BigImg bigImg) throws Exception {
        String sql = "INSERT INTO bigimg(src, goodsId) VALUES (?,?)";

        connection = JDBCUtils.getConnection();
        pstm = connection.prepareStatement(sql);

        pstm.setString(1,bigImg.getSrc());
        pstm.setInt(2,bigImg.getGoodsId());
        pstm.executeUpdate();
        JDBCUtils.close(pstm,connection);
    }
}
